Dim fpath
Dim ctype
Dim filename
Set args = WScript.Arguments
If args.Count > 0 Then
fpath= WScript.Arguments(0)
ctype= WScript.Arguments(1)
filename = fpath & "\" & "pom.xml"
'MsgBox fpath & "--" & ctype & "--" & filename
Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
Set f=fso.opentextfile(filename )
If ctype = 1 then
s=replace(f.readall,"<packaging>war</packaging>","<packaging>jar</packaging>")
End if
If ctype = 2 then
s=replace(f.readall,"<packaging>jar</packaging>","<packaging>war</packaging>")
End if
f.close
Set r=fso.opentextfile(filename ,2,true)
r.write s
else
msgbox "no arguments!"
end if
Wscript.quit
